package com.cloudcc.ccTool;

import com.alibaba.fastjson.JSONObject;

import java.util.HashMap;

public class ServiceResult extends HashMap {
    public String success;
    public String message;
    public String Id;

	public void addErrorMessage(String msg) throws Exception{
        this.put("message",msg);
        this.put("success","false");
        throw new Exception(msg);
    }

    public String getErrorMessage(){
        return message;
    }
    public String getMessage(){
        return (String)this.get("message");
    }

    public String getSuccess(){
        return   (String)this.get("success");
    }
    public String getId(){
        return   (String)this.get("id");
    }

    @Override
    public String toString(){
        JSONObject data = new JSONObject();
        data.putAll(this);
        return data.toString();
    }

    public String getRtnInfo(){
        return "";
    }
    public boolean isSuccess(){
        return true;
    }
}
